/* You can add global styles to this file, and also import other style files */

// Required to use ngx-page-scroll service https://github.com/TEAMMATES/teammates/pull/12224#issuecomment-1480350769.
html {
  scroll-behavior: auto !important;
}

body {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.875rem;
}

ul {
  margin-bottom: 0;
}

h1,
.h1 {
  font-size: 2.1875rem;
}

h2,
.h2 {
  font-size: 1.75rem;
}

h3,
.h3 {
  font-size: 1.53125rem;
}

h4,
.h4 {
  font-size: 1.3125rem;
}

h5,
.h5 {
  font-size: 1.09375rem;
}

h6,
.h6 {
  font-size: 0.875rem;
}

.btn,
.form-control,
.dropdown-item {
  font-size: 0.875rem;
}

.color-orange {
  color: #e46d0b;
}

.color-blue {
  color: #4379d1;
}

.hidden {
  display: none;
}

.modal {
  text-align: center;
}

.modal::before {
  content: '';
  display: inline-block;
  height: 100%;
  vertical-align: middle;
}

.modal-header {
  padding: 0.75rem 1rem;
  word-break: break-word !important;
  word-wrap: break-word !important;
}

.modal-body {
  padding: 1rem 1.25rem;
  word-break: break-word !important;
  word-wrap: break-word !important;
}

.modal-footer {
  padding: 0.3rem 0.5rem;
}

.modal-dialog {
  text-align: left;
  display: inline-block;
  max-height: 90vh;
  max-width: 70vw;
  min-width: 30vw;
  scrollbar-width: none; // Firefox
  -ms-overflow-style: none; // IE10+
  vertical-align: middle;

  &::-webkit-scrollbar {
    // Webkit-based browsers
    width: 0;
    height: 0;
  }
}

.modal-large .modal-dialog {
  width: 1000px;
}

@media (width <= 768px) {
  .modal-dialog {
    max-width: none;
    min-width: 65vw;
    max-height: none;
    width: 95vw;
  }

  .modal-large .modal-dialog {
    width: 95vw;
  }
}

.close:focus {
  outline: 0;
}

.table {
  margin-bottom: 0;

  & th,
  td {
    padding: 0.5rem;
  }
}

.card {
  margin-bottom: 20px;
}

.card-header {
  align-items: center;
  display: flex;
  padding: 0.5rem 1rem;
}

.card-header-btn-toolbar {
  align-items: center;
  margin-left: auto;
  text-align: right;

  button {
    margin-right: var(--btn-margin);
  }

  .btn-primary {
    background-color: darken(#007bff, 5%); // 5% darker than primary
  }

  .btn-secondary {
    background-color: darken(#6c757d, 10%); // 10% darker than secondary
  }

  .btn-info {
    background-color: darken(#0dcaf0, 3%); // 3% darker than info
  }
}

.dropdown-item {
  &:focus,
  &:hover {
    background-color: #dae0e5;
  }
}

.form-control::placeholder {
  opacity: 0.7;
}

.text-preserve-space {
  white-space: pre-wrap;
}

.cursor-pointer {
  cursor: pointer;
}

.ngb-tooltip-class {
  text-decoration: underline dotted #808080;

  &:hover {
    text-decoration: underline dotted #000;
  }
}

.modal-window-class {
  color: #000;
  text-decoration: underline dashed #000;
  cursor: pointer;
}

@media print {
  .no-print {
    display: none;
  }
}

// cursor not-allowed for input disabled attribute and tinyMCE's disabled
[disabled],
.editor.editor-disabled {
  cursor: not-allowed;
}

.btn-light {
  border: 1px solid #ddd;

  &[disabled] {
    border: 1px solid #eee;
  }
}

:root {
  --btn-margin: 5px;
}

.btn-margin-left {
  margin-left: var(--btn-margin);
}

.btn-margin-right {
  margin-right: var(--btn-margin);
}

.btn-margin {
  margin: var(--btn-margin);
}

.fa-sort-down,
.fa-sort-up {
  color: black;
}

.fa-sort {
  color: #ccc;
}

.fa-sort,
.fa-sort-up,
.fa-sort-down {
  // copied from fa-stack-X
  left: 0;
  position: absolute;
  text-align: center;
  line-height: inherit;
}

.fa-stack {
  width: auto;
}

.ngb-dp-today > .btn-light {
  font-weight: bold;
  color: blue;
}

.handsontable .invalid-row,
.red-box {
  background: #f19491;
}

.handsontable .new-row,
.green-box {
  background: #aeeba6;
}

.handsontable .modified-row,
.yellow-box {
  background: #fcf4b3;
}

.handsontable .unchanged-row,
.grey-box {
  background: #ddd;
}

.handsontable .valid-row {
  background: white;
}

.alert.alert-no-bottom {
  margin-bottom: 0;
}

// new rules to adapt to Bootstrap 5 changes

.btn-link {
  text-decoration: none;
}

label {
  margin-bottom: 0.5rem;
}

.form-group {
  margin-bottom: 1rem;
}

// end of new rules to adapt to Bootstrap 5

// overrides default bootstrap colours to increase contrast
.navbar-dark {
  --bs-navbar-color: rgb(255 255 255 / 75%);
  --bs-navbar-hover-color: white;
}

// mouse hover on the icon "i"
a:hover {
  cursor: pointer;
}

// dotted line below the icon "i"
a i.fa-info-circle {
  border-bottom: 2px dotted #000;
  padding-bottom: 2px;
  box-sizing: border-box;
}

// overrides default table-responsive scrolling
.table-responsive {
  -webkit-overflow-scrolling: auto;
}
